/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-11-21
 * Time: 15:42
 */
public class Test {
    public String name = "admin";
    public String passWorld = "123456";
    public  void func(String name, String passWorld) {
        if(!this.name .equals(name)) {
            throw new userNameException("用户名错误");
        }
        if(!this.passWorld.equals(passWorld)) {
            throw new passWorldException("密码错误");
        }
    }
    public static void main(String[] args) {
        Test test = new Test();
        try {
            test.func("admin1","123456");
        } catch (userNameException e) {
            e.printStackTrace();
            System.out.println("用户名输入异常!");
        } catch (passWorldException e) {
            e.printStackTrace();
            System.out.println("密码输入异常!");
        }
        finally {
            System.out.println("结束进程");
        }
    }
}
